home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / 68k-ppc.txt next >
Text File  |  1980-01-06  |  12KB  |  379 lines

  1.  
  2.          .------------------------------------------------------.
  3.          | MC680x0 Assembly Source to Power-PC Conversion Chart |
  4.          `------------------------------------------------------'
  5.  
  6.                                 Written for
  7.                                     the
  8.                            - Digital Candy CD -
  9.  
  10.  
  11. With the event of Amiga Technologies naming Motorola`s PowerPC Reduced
  12. instruction micro processor as the successor to the MC68000`s series in
  13. the beloved Amiga we present you some information regarding the PowerPC
  14. chip`s.
  15.  
  16. This text is a PowerPC Instruction Reference. This text contains a lot of
  17. helpful descriptions for `porting' MC680x0 written assembly language source
  18. over to PowerPC assembly. An "automatic" source-code translator should be
  19. available for mid `96 on Digital Candy!. This will do 90% of the assembly
  20. translation process automatically for you hence making conversion much less
  21. painful! Please note that really the PowerPC RISC chips are nothing more
  22. than redesigned from ground up MC680x0 cpu`s. Nothing stupid like Intel`s
  23. efforts with 8086 and the like! -  Thank god! :)
  24.  
  25. A useful purpose of releasing this information is to make coders aware of
  26. the unsupported MC680x0 instructions that don`t exist on the PPC chips.
  27. This will allow MC680x0 coders to write future MC68000 code that doesn`t
  28. use them - this will help making translation of your MC68000 source much
  29. easier!
  30.  
  31. For a full description of the PowerPC instruction set keep an eye out on
  32. Digital Candy BBS.
  33.  
  34.  
  35.  
  36. Enjoy!
  37.  
  38.  
  39.  
  40. .---------------------.---------------.-------------------------------------.
  41. | Description         | Asm MC680x0   |    PowerPC Description                 |
  42. `---------------------^---------------^-------------------------------------'
  43. Add BCD              ABCD  (000+)    Not supported directly.
  44.  
  45. Add              ADD   (000+)    Use suitable add instruction.
  46.  
  47. Add Address          ADDA  (000+)    Use suitable add instruction.
  48.  
  49. Add Immediate          ADDI  (000+)    Use add immediate if immediate
  50.                     value is not greater than 16 bits.
  51.                     Use a register to create a tempory
  52.                     immediate value if a larger immediate
  53.                     value is needed.
  54.  
  55. Add Quick             ADDQ  (000+)    Use add immediate.
  56.  
  57. Add with Extend       ADDX  (000+)    Use suitable add instruction.
  58.  
  59. Logical AND         AND   (000+)    Use the and instruction.
  60.  
  61. Logical AND        ANDI  (000+)    Use and immediate instruction.
  62. with Immediate          
  63.  
  64. Arithmetic Shift Left    ASL   (000+)    Use appropriate rotate or shift left
  65.                     instruction to simulate the operation.
  66.  
  67. Arithmetic Shift Left    ASR   (000+)    Use appropriate rotate or shift right
  68.                     instruction to simulate the operation
  69.  
  70. Branch if Condition    Bcc   (000+)    Use appropritae branch instruction
  71. is True (e.g. BNE.)            taking into account speculative
  72.                     execution. (see doc`s)
  73.  
  74. Test bit and change    BCHG  (000+)    Not supported directly. Requires
  75.                     simulation using the reservation
  76.                     station technique to provide the
  77.                     atomic operation. (see doc`s)
  78.  
  79. Test bit and clear    BCLR  (000+)    Not supported directly. Requires
  80.                     simulation using the reservation
  81.                     station technique to provide the
  82.                     atomic operation. (see doc`s)
  83.  
  84. Test bit field and    BFCHG (020+)    Not supported directly. Requires
  85. change                    simulation using the reservation
  86.                     station technique to provide the
  87.                     atomic operation. (see doc`s)
  88.  
  89. Test bit field and    BFCLR (020+)    Not supported directly. Requires
  90. clear                    simulation using the reservation
  91.                     station technique to provide the
  92.                     atomic operation. (see doc`s)
  93.  
  94. Extract signed bit    BFEXTS (020+)    Use an appropritate rotate or
  95. field                    shift instruction to simulate the
  96.                     operation.
  97.  
  98. Extract unsigned bit    BFEXTU (020+)    Use an appropritate rotate or
  99. field                    shift left instruction to simulate
  100.                     the operation.
  101.  
  102. Bit field find first 1    BFFFO (020+)    Use an appropritate rotate or shift
  103. field                    left instruction(s) to simulate the
  104.                     operation. Count leading zeros can
  105.                     also be used as part of simulation.
  106.  
  107. Insert Bit field    BFINS (020+)    Use an appropriate roatate or shift
  108.                     instructions(s).
  109.  
  110. Test bit field & Set    BFSET (020+)    Not supported directly. Simulate
  111.                     using the reservation station
  112.                     technique to provide the atomic
  113.                     operation.
  114.  
  115. Test bit field        BFTST (020+)    Not supported directly. Simulate
  116.                     using the reservation station
  117.                     technique to provide the atomic
  118.                     operation.
  119.  
  120. Set Breakpoint        BKPT  (000+)    Not supported directly. Use
  121.                     breakpoint registers in the cpu
  122.                     supervisor model to set breakpoints.
  123.  
  124. Unconditional branch    BRA   (000+)    Use Branch always instruction.
  125.  
  126. Set Bit            BSET (000+)    Not supported directly. Simulation
  127.                     is required using reservation station
  128.                     technique to provide the atomic
  129.                     operation.
  130.  
  131. Branch to subroutine    BSR (000+)    Use a suitable branch instruction
  132.                     that uses the link register. The
  133.                     choice will depend on how far your
  134.                     target address is. The link register
  135.                     contents may need saving in order
  136.                     to preserve the context of any
  137.                     previous branches. The system call
  138.                     instruction can also be used in
  139.                     some circumstances. Messy? Answers
  140.                     On a postcard to Motorola please.
  141.                     Hopefully the PowerPC assemblers
  142.                     will do this part automatically
  143.                     for coders.            
  144.  
  145. Test Bit        BTST (000+)    Not supported directly. Simulation
  146.                     is required using reservation station
  147.                     technique to provide the atomic
  148.                     operation.
  149.  
  150. Call Module        CALLM (020+)    Not supported directly.
  151.  
  152. Compare & Swap Operands    CAS (000+)    Not supported directly. Simulation
  153.                     is required using reservation station
  154.                     technique to provide the atomic
  155.                     operation.
  156.  
  157. Compare & Swap Dual Ops    CAS2 (020+)    Not supported directly. Simulation
  158.                     is required using reservation station
  159.                     technique to provide the atomic
  160.                     operation.
  161.  
  162. Check Reg Against Bound    CHK (000+)    Not supported directly. Simulation
  163.                     is required using reservation station
  164.                     technique to provide the atomic
  165.                     operation.
  166.  
  167. Check Upr/lower Bound    CHK2 (020+)    Not supported directly. Simulation
  168.                     is required using reservation station
  169.                     technique to provide the atomic
  170.                     operation.
  171.  
  172. Clear            CLR (000+)    Use R0 within an add or logical
  173.                     operation to write $00000000 into
  174.                     the target register. If the location
  175.                     is in external memory, use a store
  176.                     instruction with R0 instead.
  177.  
  178. Compare            CMP (000+)    Not supported directly. Simulation
  179.                     is required using reservation station
  180.                     technique to provide the atomic
  181.                     operation.
  182.  
  183. Compare Upr/Lower Bound    CMP2 (020+)    Not supported directly. Simulation
  184.                     is required using reservation station
  185.                     technique to provide the atomic
  186.                     operation.
  187.  
  188. Compare Address        CMPA (000+)    Use a suitable compare instruction.
  189.  
  190. Compare Immediate    CMPI (000+)    Use a suitable compare instruction.
  191.  
  192. Cmp Memory with Memory    CMPM (000+)    Not supported directly. Simulation
  193.                     is required using reservation station
  194.                     technique to provide the atomic
  195.                     operation.
  196.  
  197. Test,decrement,branch    DBcc (000+)    Use branch instruction that
  198. if Condition is true            decrements the CTR register to
  199.                     simulate.
  200.  
  201. Signed Divide        DIVS (000+)    Use the divide instruction but
  202.                     remember that PowerPC cpu`s
  203.                     instructions do not create
  204.                     remainder directly.
  205.  
  206. Signed Divide        DIVSL (020+)    Use the divide instruction but
  207.                     remember that PowerPC cpu`s
  208.                     instructions do not create
  209.                     remainder directly.
  210.  
  211. Unsigned Divide        DIVU (000+)    Use the divide instruction but
  212.                     remember that PowerPC cpu`s
  213.                     instructions do not create
  214.                     remainder directly.
  215.  
  216. Unsigned Divide        DIVUL (020+)    Use the divide instruction but
  217.                     remember that PowerPC cpu`s
  218.                     instructions do not create
  219.                     remainder directly.
  220.  
  221. Exclusive Logical OR    EOR (000+)    Use the XOR instruction.
  222.  
  223. Exclusive OR Immediate    EORI (000+)    Use the XORI instruction.
  224.  
  225. Exchange Registers    EXG (000+)    Not supported directly.
  226.  
  227. Sign Extend        EXT (000+)    Use an extend instruction.
  228.  
  229. Sign Extend        EXTB (000+)    Use the extend byte instruction
  230.  
  231. Illgal Opcode Trap    ILLEGAL (000+)    Illegal opcode will be trapped out
  232.                     by PowerPC Cpu`s. Hence there is no
  233.                     defined illegal instruction. Any 
  234.                     invalid instruction will do.
  235.  
  236. Jump            JMP (000+)    Use a branch always instruction
  237.  
  238. Load Effective Address    LEA (000+)    Use an add immediate instruction
  239.  
  240. Link register to stack     LINK (000+)    Not supported directly.
  241.  
  242. Logical Shift Left    LSL   (000+)    Use appropriate rotate or shift left
  243.                     instruction to simulate the operation.
  244.  
  245. Logical Shift Left    LSR   (000+)    Use appropriate rotate or shift right
  246.                     instruction to simulate the operation
  247.  
  248. Move Condition Code    MOVE CCR (000+)    Use a CCR instruction to move the
  249.                     contents of a condition field to
  250.                     another. Use a move to or move from
  251.                     condition register instruction.
  252.  
  253. Move Address        MOVEA (000+)    Use an add or logical instruction
  254.                     to move the register contents to
  255.                     another register. A store instruction
  256.                     will be needed to mvoe the contents
  257.                     to memory.
  258.  
  259. Move Status Register    MOVE SR    (000+)    Use the move to and from MSR
  260.                     instructions.
  261.  
  262. Move User Stack        MOVE USP (000+)    Use an add or logical instruction
  263. Pointer                    to move the register contents to
  264.                     another register. A store instruction
  265.                     will be needed to mvoe the contents
  266.                     to memory.
  267.  
  268. Move Control Register    MOVEC (020+)    Use an appropritate move to and
  269.                     move from instruction e.g. move to
  270.                     special purpose register.
  271.  
  272. Move Multiple registers    MOVEM (000+)    Use store multiple words to move
  273.                     registers to memory. Use the Load
  274.                     multiple words to restore them.
  275.  
  276. Move peripheral data     MOVEP (000+)    Not supported directly.
  277.  
  278. Move Quick        MOVEQ (000+)    Use an Add or logical immediate
  279.                     instruction to simulate.
  280.  
  281. Move alternative     MOVES (020+)    Not supported directly.
  282. address space        
  283.  
  284. Signed Multiply        MULS (000+)    Use the Multiply High and low
  285.                     instructions to simulate the
  286.                     multiply instruction
  287.  
  288. Unsigned Multiply    MULU (000+)    Use the Multiply High and low
  289.                     instructions to simulate the
  290.                     multiply instruction
  291.  
  292. Negate BCD data        NBCD  (000+)    Not supported directly.
  293.  
  294. Negate            NEG   (000+)    Not supported directly.
  295.  
  296. Negate with extend    NEGX  (000+)    Not supported directly.
  297.  
  298. No-operation        NOP   (000+)    Not supported directly. Simulate with
  299.                     logic operation that uses register 0
  300.                     (r0) to do nothing. E.g. in PPC
  301.                     code;    ORI 0,0,0
  302.  
  303. Logical Complement    NOT (000+)    Use NAND instruction
  304.  
  305. Logical OR        OR (000+)    Use the OR instruction
  306.  
  307. Logical OR Immediate    ORI (000+)    Use the OR Immediate instruction
  308.  
  309. Pack BCD data        PACK  (020+)    Not supported directly.
  310.  
  311. Push Effective address    PEA   (000+)    Not supported directly. Manipulate
  312.                     addresses directly.
  313.  
  314. Reset Peripherals    RESET (000+)    Not supported directly.
  315.  
  316. Rotate Bits Left    ROL (000+)    Use an appropriate rotate instruction
  317.  
  318. Rotate Bits Right    ROR (000+)    Use an appropriate rotate instruction
  319.  
  320. Rotate Bits Left with    ROXL (000+)    Use an appropriate rotate instruction
  321. Extend
  322.  
  323. Rotate Bits Right with    ROXL (000+)    Use an appropriate rotate instruction
  324. Extend
  325.  
  326. Return from Exception    RTE   (000+)    Now called the Return-From-Interrupt
  327.                     in PPC terminology hence use, RTI.
  328.  
  329. Return from Module    RTM (020+)    Not supported directly.
  330.  
  331. Return and Restore    RTR (020+)    Not supported directly.
  332.  
  333. Return from Subroutine    RTS (000+)    Use branch always instruction with
  334.                     the destination address in the link
  335.                     register.
  336.  
  337. Subtract BCD        SBCD (000+)    Not supported directly.
  338.  
  339. Set byte conditionally    Scc (000+)    Not supported directly.
  340.  
  341. Stop cpu        STOP (000+)    Not supported directly.
  342.  
  343. Subtract Memory        SUB (000+)    Use an appropriate subtract
  344.                     instruction
  345.  
  346. Subtract Address    SUBA (000+)    Use an appropriate subtract
  347.                     instruction
  348.  
  349. Subtract Immediate    SUBI (000+)    Use an appropriate subtract
  350.                     instruction
  351.  
  352. Subtract Quick        SUBQ (000+)    Use an appropriate subtract
  353.                     instruction
  354.  
  355. Subtract with Extend    SUBX (000+)    Use an appropriate subtract
  356.                     instruction
  357.  
  358. Swap register words    SWAP (000+)    Not supported directly.
  359.  
  360. Test operand and set    TAS (000+)    Not supported directly. Who care`s
  361.                     though? The Amiga never supported
  362.                     it anyway due to hardware contention.
  363.  
  364. Trap            TRAP (000+)    Not supported directly.
  365.  
  366. Conditional Trap    TRAPcc(000+)    Not supported directly.
  367.  
  368. Trap on Overflow    TRAPV (000+)    Not supported directly.
  369.  
  370. Test operand        TST (000+)    Not supported directly.
  371.  
  372. Unlink from stack    UNLK (000+)     Not supported directly.
  373.  
  374. Unpack BCD data        UNPK (000+)     Not supported directly.
  375.  
  376.  
  377. -----------------------------------------------------------------------------
  378. End.
  379.